<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 100px;
            background-color: pink;
            /* 动画名，动画时长，速度曲线，延迟时间，重复次数，动画方向，执行完毕时状态 */
            /* 匀速速度曲线 */
            animation: change 1s linear;
            /* 分步速度曲线 */
            animation: change 1s steps(3);

            /* 延迟时间 */
            animation: change 1s 2s;

            /* 重复次数 infinite:无限循环*/
            animation: change 1s 3;
            animation: change 1s infinite;

            /* alternate:反向 */
            animation: change 1s infinite alternate;

            /* 动画结束状态 */
            /* 开始状态 */
            animation: change 1s forwards;
            /* 结束状态 */
            animation: change 1s backwards;
        }

        /* 两种状态写法 */
        @keyframes change {
            from {
                width: 200px;
            }

            to {
                width: 800px;
            }

        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>